﻿@{
    Layout = null;
}
@model UcAsp.Models.Comments
<!DOCTYPE html>
<script>
    $(document).ready(function () {
        $(".button").click(function () {
            $.post("/InfoManager/SaveComments", { ID: $("input[name='ID']").val(), PublichContent: tinyMCE.get("PublichContent").getContent() }, function (dataResult) {
                $.facebox.close()
                location.reload();
            })
        });
        $(".deleteclose").click(
            function () {                
                $.post("/InfoManager/DelComments", { ID: $(this).attr("data-id") }, function (dataResult) {
                });
                $(this).parent().fadeTo(400, 0, function () { // Links with the class "close" will close parent
                    $(this).slideUp(400);
                    $(this).parent().slideUp(400);

                });
                return false;
            }
        );

    });

</script>
<html>
<head>
    <script>

        tinymce.init({
            selector: "textarea",
            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste hr upfile"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |link image upfile"

        });
    </script>
    <title>ReplyComment</title>
</head>
<body>
    <div> <form action="#" method="post">
    <div>
        <p>@Model.Title</p>
         <p>@Model.PublichContent</p>
        <input name="ID" type="hidden" value="@Model.ID" />
        <p>已回复</p>
        
      
          @foreach(UcAsp.Models.Comments comments in ViewData["Comments"] as List<UcAsp.Models.Comments>)
          {<div class="notification  attention png_bg">
              <div> <a href="#" class="deleteclose" data-id="@comments.ID"><img src="/content/resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close"></a>
            <p>@(new HtmlString(comments.PublichContent))</p>
              @comments.ReplyDateTime
              </div>
              </div>
          }

      
    
        <p>
              <label>回复</label>
              <textarea id="PublichContent" name="PublichContent" cols="20" rows="2"></textarea>
        </p></div>
        <input class="button" type="button" value=" 保存 " />
      
        </form>
    </div>
</body>
</html>
